/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 * Buttons are align vertically
 * @author: jin Chen 
 * @date: Nov 18, 2004$
 * @version: 1.0
 */
package edu.psu.geovista.app.pcp.toolkits.selectcontrol.ui;

import javax.swing.*;
import java.awt.*;

public class VerticalBttnsPane extends JPanel implements SwingConstants{
    JToolBar toolbar=new JToolBar();

    public VerticalBttnsPane() {
        toolbar.setFloatable(false);
        toolbar.setOrientation(1);
        toolbar.setRollover(true);
         this.setLayout(new java.awt.GridBagLayout());
        add(toolbar, new java.awt.GridBagConstraints());
    }
    // 
    public void setAlignment(int align){
        this.removeAll();
        if(align==CENTER){
            this.setLayout(new java.awt.GridBagLayout());
            add(toolbar, new java.awt.GridBagConstraints());

        }
        else if(align==TOP){
            this.setLayout(new FlowLayout());
            add(toolbar);
        }
    }

    public JToolBar getToolbar() {
        return toolbar;
    }

    public void setToolbar(JToolBar toolbar) {
        this.toolbar = toolbar;
        this.toolbar.setOrientation(1);

    }

}
